INCLUDES:=./
SRCS:=$(wildcard *.cc)
LIBS:=  -lwfrest -lworkflow -lssl -lcrypto -lcrypt -lSimpleAmqpClient
CONSUMERLIBS:= -fno-rtti -lalibabacloud-oss-cpp-sdk -lcurl -lpthread  -lssl -lcrypto -lcrypt -lSimpleAmqpClient
OBJS:=$(patsubst %.cc, %.o, $(SRCS))
SERVER:=server
HASH:=hash
TOKEN:=token
OSS:=oss
CONSUMER:=consumer

$(SERVER): main.o hash.o token.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

%.o:%.cc
	g++ -c $^ -o $@ $(CONSUMERLIBS) $(addprefix -I, $(INCLUDES)) -g

$(HASH): hash.o testhash.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

$(TOKEN): token.o testToken.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

$(OSS): testOss.o
	g++ $^ -o $@ $(CONSUMERLIBS) $(addprefix -I, $(INCLUDES)) -g
$(CONSUMER): consumer.o
	g++ $^ -o $@ $(CONSUMERLIBS) $(addprefix -I, $(INCLUDES)) -g



clean:
	rm -rf $(OBJS) $(SERVER) $(HASH) $(TOKEN) $(OSS) $(CONSUMER)
